package com.qingke.easyjava.jdbc.command.impl;

import com.qingke.easyjava.jdbc.command.PlayerCommand;
import com.qingke.easyjava.jdbc.pojo.Player;
import com.qingke.easyjava.jdbc.util.QingkeConsole;

public class ScoreCommand extends PlayerCommand {

    public ScoreCommand(Player player) {
        super(player);
    }

    @Override
    public void executePlayerCommand() {
        QingkeConsole.println("============= " + player.getName() + " ============");
        QingkeConsole.println("= 总提问数：" + player.getQuestions().size());
        QingkeConsole.println("= 总回答数：" + player.getAnswers().size());
        QingkeConsole.println("= 当前总分：" + player.getScore());
        
        int score = player.getScore();
        String level = "弱鸡";
        if (score > 100) {
            level = "学霸";
        } else if (score > 60) {
            level = "学生";
        } else if (score > 30) {
            level = "学渣";
        }
        

        QingkeConsole.println("= 当前段位：" + level);
    }

}
